extends CharacterBody2D
var speed = 300

func get_input():
	var input_dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
	velocity = input_dir * speed

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	pass # Replace with function body.
	


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass
	get_input()
	move_and_collide(velocity * delta)
	var collision = move_and_collide(velocity * delta)
	if collision:
		print("我 collided with ", collision.get_collider().name)
	
	move_and_slide()

	
	
